<?php

	require_once("../../../include/connect.php");
	require_once("../../../include/datetime.php");
	
	$name = $_POST['name'];
	$url = $_POST['url'];
	$date = day_now();
	
	if($name != "")
	{
		$q = mysql_query(" INSERT INTO new_link(name,url,date) VALUES(N'$name', '$url', '$date') ");
		if($q)
			header("Location:../index.php?p=new_link&msg=success");
		else
			header("Location:../index.php?p=new_link&msg=fail");
	}
	else
		header("Location:../index.php?p=new_link&msg=null");
?>